package com.zut.demo1.controller;

import com.zut.demo1.dao.ImgMapper;
import com.zut.demo1.model.Img;
import com.zut.demo1.service.ImgService;
import com.zut.demo1.utils.Msg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;

@RestController
public class ImgController {

    @Autowired
    private ImgService imgService;

    @GetMapping("/countType")
    public Msg countTime(Img img){


        int conut1 = imgService.getcount1(img);   //总人数
        int conut2 = imgService.getcount2(img);   //上课人数
        int conut3 = imgService.getcount3(img);   //睡觉人数

        return Msg.success().add("count1",conut1).add("count2",conut2).add("count3",conut3);
    }
}
